#!/bin/sh

set -e

test "$CC" || export CC=cc
test "$CFLAGS" || export CFLAGS="-g -Og"
export CFLAGS="$CFLAGS -std=c89 -Wall -Wextra -ftrapv -fno-strict-aliasing"

goal() {
	local target="$1"
	shift
	if [ ! -e "$target" ]
	then
		echo "updating $target" >&2
		return 0
	fi
	local f
	for f in "$@"
	do
		if [ "$f" -nt "$target" ]
		then
			echo "updating $target" >&2
			return 0
		fi
	done
	return 1
}

cdp() {
	cd $1
	echo "-- `pwd`" >&2
}

. $1

exit 0
